package com.wmapp.connect;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class ConnectConfig {
    //public static final String DEFAULT_IP="mymcu.gnway.net";

    public static String DEFAULT_IP = "127.0.0.1";
    private String ip = DEFAULT_IP;
    private int port = 5040;

    public ConnectConfig() {
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ipConfig.properties");
        Properties p = new Properties();
        try {
            p.load(inputStream);
        } catch (IOException e1) {
            e1.printStackTrace();
        }
        System.out.println("ip:" + p.getProperty("ip") + ",port:" + p.getProperty("port"));
        DEFAULT_IP = p.getProperty("ip");
    }

    public ConnectConfig(String ip, int port) {
        this.ip = ip;
        this.port = port;
    }

    public String getIp() {
        return ip;
    }

    public int getPort() {
        return port;
    }
}
